home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 0411.ZIP / KEYS.C < prev    next >
Text File  |  1985-07-22  |  390b  |  16 lines

  1. /*
  2.  * Program to read the keyboard and return the hex and decimal equivalents.
  3.  */
  4. #include "stdio.h"
  5. main()
  6.     {
  7.     int  c;
  8.     puts("Press a key to find its hex and decimal codes (^Z to exit)\n");
  9.     while ((c = getchar()) != EOF)
  10.     {
  11.     printf("\r%c is: %xH and %u\n\n",c,c,c);
  12.     puts("Press a key to find its hex and decimal codes (^Z to exit)\n");
  13.     }
  14.     exit(0);
  15.     }
  16.